Namespace Tafi.VisionColor.UI

    Partial Class Forms_FrmMenuSolicitudes
        Inherits Tafi.Portal.UI.PortalPage

        Dim GruposHabilitados As String = ""

        Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
            GruposHabilitados = Owner.Framework.Configuration.SettingsManager.GetValue("GruposHabilitados")
            If Not IsPostBack Then
                CargarMenu()
            End If
        End Sub

        Protected Sub LnkEntrar_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles LnkEntrar.Click
            Response.Redirect("../Forms/FrmSolicitud.aspx?Id=" & HdnID.Value & "&Descri=" & HdnDescri.Value, False)
        End Sub

        Protected Sub Grid_RowCreated(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles Grid.RowCreated
            Dim oKey As DataKey
            If e.Row.RowType = DataControlRowType.DataRow Then
                oKey = Grid.DataKeys(e.Row.RowIndex)
                If GruposHabilitados.IndexOf("[" & oKey("GROUPID").ToString & "]") <> -1 Then
                    e.Row.Cells(e.Row.Cells.Count - 1).Text = "<input type=""button"" class=""StandartButton"" value=""Agregar"" onclick=""javascript:Entrar('" & oKey("GROUPID").ToString & "','" & oKey("DESCRIPTIONS").ToString.Replace("/", "//") & "');"" />"
                End If
                oKey = Nothing
            End If
        End Sub

#Region "Procedimientos"

        Private Sub CargarMenu()
            Dim oDepDS As Tafi.VisionColor.DataService.DepartmentsDS
            Dim oDT As Data.DataTable
            Try
                oDepDS = New Tafi.VisionColor.DataService.DepartmentsDS

                oDT = oDepDS.GetAll

                Grid.DataSource = oDT
                Grid.DataBind()

            Catch ex As Exception
                Throw ex
            Finally
                oDT = Nothing
                oDepDS = Nothing
            End Try
        End Sub

#End Region

    End Class

End Namespace
